import {defineStore} from "pinia"

export const useDataStore = defineStore("data", {
    state: () => {
        return {
            isLogin: false,//是否登录

            token:'',//登录token

            userId:'',
            userImg: '',
            nickname:'',

            fastdfsUploadUrl:'http://118.31.60.184:8030/file/fastdfs/upload'
        }
    },
    //本地持久化(把数据存储到浏览器本地)
    persist: {
        enabled: true,//是否开启持久化
        strategies: [
            {
                key: 'data', //自定义Key值,存储到本地时的key
                storage: localStorage, // 选择存储方式：本地存储
            },
        ],
    }
})
